package com.heima.article.controller.v1;

import com.heima.api.article.ApCollectionControllerApi;
import com.heima.article.service.ApCollectionService;
import com.heima.model.article.dtos.CollectionBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName ApCollectionController
 * @Description TODO
 * @Author AWei
 * @DATE 2021/4/23 0:35
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/v1/collection_behavior")
public class ApCollectionController implements ApCollectionControllerApi {

    @Resource
    private ApCollectionService apCollectionService;

    /**
     * @param dto 收藏请求收藏对象
     * @return 保存结果
     * @Description 保存收藏行为
     */
    @Override
    @PostMapping
    public ResponseResult collection(@RequestBody CollectionBehaviorDto dto) {
        return apCollectionService.collection(dto);
    }
}
